import { fromJS } from 'immutable';
import * as constants from './constants';

const defaultState = fromJS({
	announce: [],
	allAnnounce: [],
	content: {},
	banner: []
});

export default (state = defaultState, action) => {
	switch(action.type) {
		case constants.GET_ANNOUNCE:
			return state.set('announce', action.value);
		case constants.CHANGEALLANNOUNCE:
			return state.set('allAnnounce', action.value);
		case constants.CHANGECONTENT:
			return state.set('content', action.value);
		case constants.CHANGEBANNER:
			return state.set('banner', action.value);
		default:
			return state;
	}
}